// 表单校验
export default (that:any, key:string, rules: any) => {
  console.log(that, key, rules)
  console.log(that[key])
	if (that[key].trim().length === 0) {
		uni.showToast({
			title: rules[key].name + '不能为空',
			icon: 'none'
		});
		return false;
	}
	
	if (!rules[key].rule.test(that[key])) {
		uni.showToast({
			title: rules[key].msg,
			icon: 'none'
		});
		return false;
	}

	return true;
}